package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type MysqlConfig struct {
	Host     string
	Port     int
	User     string
	Password string
	Database string
}

type AppConfig struct {
	MysqlConfig
}

var AppConf AppConfig

func Init() {
	viper.SetConfigFile("./appconfig/dev.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)
	fmt.Println("动态读取配置成功", AppConf)
}
